package com.cadre.web.controller.officer;

import com.cadre.common.utils.R;
import com.cadre.system.domain.officer.AssessInfo;
import com.cadre.system.domain.officer.PersonInfor;
import com.cadre.system.service.AssessService;
import com.cadre.system.service.DIC_ZBService;
import com.cadre.system.service.PersonService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@RequestMapping({"/personUp"})
@RestController
/* loaded from: PersonUpMsgController.class */
public class PersonUpMsgController {
    @Resource
    private DIC_ZBService dIC_ZBService;
    @Resource
    private PersonService personService;
    @Resource
    private AssessService assessService;

    @RequestMapping(value = {"/Categorylist"}, method = {RequestMethod.GET})
    public R Categorylist() {
        Map<String, Object> map = new HashMap<>();
        map.put("tableName", "DIC_ZB125");
        return R.ok().put("data", (Object) this.dIC_ZBService.getAll(map));
    }

    @RequestMapping(value = {"/getDIC_ZB1004"}, method = {RequestMethod.GET})
    public R getDIC_ZB1004() {
        Map<String, Object> map = new HashMap<>();
        map.put("tableName", "DIC_ZB1004");
        return R.ok().put("data", (Object) this.dIC_ZBService.getAll(map));
    }

    @RequestMapping(value = {"/Ranklist"}, method = {RequestMethod.GET})
    public R Ranklist() {
        Map<String, Object> map = new HashMap<>();
        map.put("tableName", "DIC_ZB09");
        return R.ok().put("data", (Object) this.dIC_ZBService.getAll(map));
    }

    @RequestMapping({"/insert"})
    public R insert(@RequestBody PersonInfor personInfor) {
        return R.ok().put("data", (Object) Integer.valueOf(this.personService.insert(personInfor)));
    }

    @RequestMapping({"/assessSave"})
    public R assessSave(AssessInfo[] assessInfos) {
        if (assessInfos.length == 0) {
            for (AssessInfo assessInfo : assessInfos) {
                this.assessService.assessSave(assessInfo);
            }
        }
        return R.ok();
    }
}
